我创建了一个sockt.io应用程序并使用永远的npm运行它。它工作正常几个小时但在此之后停止并且日志文件中也没有错误。
我检查了很多次,但我什么也没得到。
socket.io或永远存在任何问题。
请帮帮我
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.TestLayout);
ScrollView contentScroll = FindViewById<ScrollView>(Resource.Id.contentScroll);
LinearLayout contentContainer = FindViewById<LinearLayout>(Resource.Id.contentContainer);
List<DetailsData> dataList = new List<DetailsData>();
for (int i = 0; i < 3; i++)
{
string header = "Header " + " " + i.ToString();
string title = "Title " + i.ToString();
string subtitle = "Subtitle";
string pretext = "Some words in pretext. Some words in pretext. Some words in pretext. Some words in pretext. Some words in pretext. Some words in pretext.Some words in pretext. Some words in pretext.";
int[] images = { Resource.Drawable.detail_main1, Resource.Drawable.detail_main2, Resource.Drawable.detail_main3, Resource.Drawable.detail_main1,
Resource.Drawable.detail_main2, Resource.Drawable.detail_main3, Resource.Drawable.detail_main1 };
string[] features =
{
"OSome words in featurelist.",
"OSome words in featurelist.",
"OSome words in featurelist.",
"OSome words in featurelist.",
"OSome words in featurelist.",
"OSome words in featurelist.",
"OSome words in featurelist.",
"OSome words in featurelist.",
"OSome words in featurelist.",
"OSome words in featurelist.",
};
dataList.Add(new DetailsData(i, header, title, subtitle, pretext, features, images));
}
testContainer = new TestContaier(this, dataList, contentContainer, contentScroll, false);
testContainer.DataBind();
}
class TestContaier
{
Activity _context;
public List<DetailsData> _dataSource { get; private set; }
LinearLayout _mainLayout;
ScrollView _scrollContainer;
public TestContaier(Activity context, List<HotelDetailsData> dataSource, LinearLayout mainLayout, ScrollView scrollContainer)
{
_context = context;
_dataSource = dataSource;
_mainLayout = mainLayout;
_firstExpanded = firstExpanded;
_scrollContainer = scrollContainer;
}
public void DataBind()
{
bool isFirst = true;
if (_dataSource != null)
{
foreach (var _dataItem in _dataSource)
{
TextView header = new TextView(_context)
{
Text = _dataItem._header
};
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
header.SetTextColor(Color.ParseColor(_settings._headerTextColor));
header.SetBackgroundColor(Color.ParseColor(_settings._headerBackgroundColor));
header.LayoutParameters = lp;
View contentView = _context.LayoutInflater.Inflate(Resource.Layout.DetailItem, null);
ContentViewHolder holder = new ContentViewHolder();
InitHolder(holder, contentView);
FillHolder(holder, _dataItem);
contentView.Visibility = ViewStates.Gone;
holder.initialize(contentView);
contentView.Tag = holder;
header.AssociatedContent = contentView;
_mainLayout.AddView(header);
_mainLayout.AddView(contentView);
}
}
}
void InitHolder(ContentViewHolder holder, View view)
{
holder.imageSlider = view.FindViewById<ViewFlipper>(Resource.Id.imageSlider);
holder.imagesContainer = view.FindViewById<LinearLayout>(Resource.Id.scrollImagesContainer);
holder.detailTitle = view.FindViewById<TextView>(Resource.Id.detailTitle);
holder.detailSubtitle = view.FindViewById<TextView>(Resource.Id.detailSubtitle);
holder.detailPretext = view.FindViewById<TextView>(Resource.Id.detailPreText);
holder.detailFeatureList = view.FindViewById<LinearLayout>(Resource.Id.detailFeatureList);
holder.nextSliderButton = view.FindViewById<ImageButton>(Resource.Id.nextSliderButton);
holder.prevSliderButton = view.FindViewById<ImageButton>(Resource.Id.prevSliderButton);
}
void FillHolder(AccordionContentViewHolder holder, HotelDetailsData dataItem)
{
/// filling holder with data
}
}
答案 0 :(得分:0)
检查
forever start server.js // name of ur js file
启动服务器后,将提及日志的名称和路径,如果有任何错误,则将它们放在此日志文件中。